<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
            Object.getOwnPropertyDescriptor() 查找对象属性的自有属性状态
            */
      const obj = {
        test: 'a',
      };
      const descriptor1 = Object.getOwnPropertyDescriptor(obj, 'test'); //拷贝到自身属性 使用场景 object.assign 无法拷贝自身属性
      console.log(descriptor1.configurable); //true
      console.log(descriptor1.value); //a
    </script>
  </body>
</html>
